<div class="max-w-md mx-auto px-2 mt-12 mb-4">
  <div class="space-y-6 mx-auto">
    <div class="space-y-6">
      <% if Docuseal.multitenant? %>
        <div class="flex items-center justify-center">
          <%= render 'start_form/docuseal_logo' %>
        </div>
      <% end %>
      <div class="flex items-center bg-base-200 rounded-xl p-4 mb-4">
        <div class="flex items-center">
          <div class="mr-3">
            <%= svg_icon('writing_sign', class: 'w-10 h-10') %>
          </div>
          <div>
            <p dir="auto" class="text-lg font-bold mb-1"><%= @submission.template.name %></p>
            <% if submitter = @submission.submitters.map(&:completed_at).max %>
              <p dir="auto" class="text-sm"><%= t('signed_on_time', time: l(submitter.to_date, format: :long)) %></p>
            <% end %>
          </div>
        </div>
      </div>
    </div>
    <% if Accounts.can_send_emails?(@submission.account) %>
      <%= form_for '', url: send_submission_email_index_path, method: :post, html: { class: 'space-y-4', onsubmit: 'event.submitter.disabled = true' } do |f| %>
        <div dir="auto" class="form-control !mt-0">
          <%= f.hidden_field :submission_slug, value: @submission.slug %>
          <%= f.label :email, t('email'), class: 'label' %>
          <%= f.email_field :email, value: current_user&.email || params[:email], required: true, class: 'base-input', placeholder: t('send_copy_to_email') %>
        </div>
        <div dir="auto" class="form-control">
          <%= f.button button_title(title: t('send_copy_to_email'), disabled_with: t('starting')), class: 'base-button' %>
        </div>
      <% end %>
      <% if Docuseal.multitenant? %>
        <div class="divider uppercase"><%= t('or') %></div>
      <% end %>
    <% end %>
    <% if Docuseal.multitenant? %>
      <div>
        <%= link_to 'Create free account', registration_path, class: 'white-button w-full' %>
      </div>
    <% end %>
  </div>
</div>
<%= render 'shared/attribution', link_path: '/start', account: @submission.account %>
